package com.ihealthway.all.groupbuy.vo;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Table;

import java.util.Date;

/**
 * Bean class for system dict design
 *
 * @author 凡梦星尘(elkan1788@gmail.com)
 */
@Table("gb_system_dict")
public class SystemDict {

    @Id
    @Column("sd_id")
    private Integer dictId;
    @Column("parent_sd_id")
    private Integer parentDictId;
    @Column("dict_level")
    private Integer dictLevel;
    @Column("dict_name")
    private String dictName;
    @Column("dict_value")
    private String dictValue;
    @Column("order_no")
    private Integer orderNo;
    @Column("remarks")
    private String remarks;
    @Column("create_time")
    private Date createTime;
    @Column("update_time")
    private Date updateTime;
    @Column("data_status")
    private String dataStatus;

    private String state;

    public Integer getDictId() {
        return dictId;
    }

    public void setDictId(Integer dictId) {
        this.dictId = dictId;
    }

    public Integer getParentDictId() {
        return parentDictId;
    }

    public void setParentDictId(Integer parentDictId) {
        this.parentDictId = parentDictId;
    }

    public Integer getDictLevel() {
        return dictLevel;
    }

    public void setDictLevel(Integer dictLevel) {
        this.dictLevel = dictLevel;
    }

    public String getDictName() {
        return dictName;
    }

    public void setDictName(String dictName) {
        this.dictName = dictName;
    }

    public String getDictValue() {
        return dictValue;
    }

    public void setDictValue(String dictValue) {
        this.dictValue = dictValue;
    }

    public Integer getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(Integer orderNo) {
        this.orderNo = orderNo;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getDataStatus() {
        return dataStatus;
    }

    public void setDataStatus(String dataStatus) {
        this.dataStatus = dataStatus;
    }

    public String getState() {
        if (this.dictLevel != 3) {
            this.state = "closed";
        } else {
            this.state = "open";
        }
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return "SystemDict{" +
                "dictId=" + dictId +
                ", parentDictId=" + parentDictId +
                ", dictName='" + dictName + '\'' +
                ", dictValue='" + dictValue + '\'' +
                ", orderNo=" + orderNo +
                ", remarks='" + remarks + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", dataStatus='" + dataStatus + '\'' +
                '}';
    }
}
